package gui;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Color;
import java.awt.GridBagLayout;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Rectangle;
import java.awt.Font;
import java.sql.SQLException;

import com.sun.rowset.CachedRowSetImpl;

import flexibility.CachedRowSetTableModel;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;


public class CourseIdActivitiesGUI extends JPanel{
	public JPanel panel;
	JLabel lblName;
	JLabel lblCourseid;
	public JButton btnManagementAssignmentsFor;
	public JButton btnGivingFeedbackTo;
	public JButton btnReturnToCourse;
	
	public CourseIdActivitiesGUI() {
			super();
			initialize();
	}
	private void initialize() {
		this.setSize(900,600);
		this.setBackground(UIManager.getColor("InternalFrame.activeTitleBackground"));
		SpringLayout springLayout = new SpringLayout();
		setLayout(springLayout);
		
		panel = new JPanel();
		springLayout.putConstraint(SpringLayout.NORTH, panel, 24, SpringLayout.NORTH, this);
		springLayout.putConstraint(SpringLayout.SOUTH, panel, 526, SpringLayout.NORTH, this);
		panel.setBackground(UIManager.getColor("InternalFrame.activeTitleBackground"));
		springLayout.putConstraint(SpringLayout.WEST, panel, 27, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.EAST, panel, 821, SpringLayout.WEST, this);
		add(panel);
		SpringLayout sl_panel = new SpringLayout();
		panel.setLayout(sl_panel);
		
		JLabel lblCourseName = new JLabel("Course Name:");
		lblCourseName.setFont(new Font("Tahoma", Font.PLAIN, 15));
		lblCourseName.setForeground(Color.BLUE);
		sl_panel.putConstraint(SpringLayout.NORTH, lblCourseName, 50, SpringLayout.NORTH, panel);
		sl_panel.putConstraint(SpringLayout.WEST, lblCourseName, 87, SpringLayout.WEST, panel);
		panel.add(lblCourseName);
		
		lblName = new JLabel("name");
		lblName.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblName.setForeground(Color.BLUE);
		sl_panel.putConstraint(SpringLayout.WEST, lblName, 47, SpringLayout.EAST, lblCourseName);
		sl_panel.putConstraint(SpringLayout.SOUTH, lblName, 0, SpringLayout.SOUTH, lblCourseName);
		panel.add(lblName);
		
		JLabel lblCourseGroup = new JLabel("Course Group:");
		lblCourseGroup.setFont(new Font("Tahoma", Font.PLAIN, 15));
		lblCourseGroup.setForeground(Color.BLUE);
		sl_panel.putConstraint(SpringLayout.NORTH, lblCourseGroup, 30, SpringLayout.SOUTH, lblCourseName);
		sl_panel.putConstraint(SpringLayout.WEST, lblCourseGroup, 0, SpringLayout.WEST, lblCourseName);
		panel.add(lblCourseGroup);
		
		lblCourseid = new JLabel("courseID");
		sl_panel.putConstraint(SpringLayout.NORTH, lblCourseid, 1, SpringLayout.NORTH, lblCourseGroup);
		sl_panel.putConstraint(SpringLayout.WEST, lblCourseid, 0, SpringLayout.WEST, lblName);
		lblCourseid.setFont(new Font("Tahoma", Font.PLAIN, 14));
		lblCourseid.setForeground(Color.BLUE);
		panel.add(lblCourseid);
		
		JLabel lblClickTheAction = new JLabel("Click the action you want to do");
		sl_panel.putConstraint(SpringLayout.NORTH, lblClickTheAction, 60, SpringLayout.SOUTH, lblCourseid);
		sl_panel.putConstraint(SpringLayout.WEST, lblClickTheAction, 0, SpringLayout.WEST, lblName);
		lblClickTheAction.setFont(new Font("Tahoma", Font.BOLD, 16));
		panel.add(lblClickTheAction);
		
		btnManagementAssignmentsFor = new JButton("Management assignments for this course");
		sl_panel.putConstraint(SpringLayout.SOUTH, btnManagementAssignmentsFor, -202, SpringLayout.SOUTH, panel);
		sl_panel.putConstraint(SpringLayout.WEST, btnManagementAssignmentsFor, 0, SpringLayout.WEST, lblName);
		btnManagementAssignmentsFor.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		btnManagementAssignmentsFor.setFont(new Font("Tahoma", Font.BOLD, 14));
		panel.add(btnManagementAssignmentsFor);
		
		btnGivingFeedbackTo = new JButton("Giving feedback to assignments for this course");
		sl_panel.putConstraint(SpringLayout.NORTH, btnGivingFeedbackTo, 52, SpringLayout.SOUTH, btnManagementAssignmentsFor);
		sl_panel.putConstraint(SpringLayout.EAST, btnManagementAssignmentsFor, 0, SpringLayout.EAST, btnGivingFeedbackTo);
		sl_panel.putConstraint(SpringLayout.WEST, btnGivingFeedbackTo, 0, SpringLayout.WEST, lblName);
		btnGivingFeedbackTo.setFont(new Font("Tahoma", Font.BOLD, 14));
		btnGivingFeedbackTo.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		panel.add(btnGivingFeedbackTo);
		
		btnReturnToCourse = new JButton("Return to Course option");
		btnReturnToCourse.setFont(new Font("Tahoma", Font.BOLD, 13));
		sl_panel.putConstraint(SpringLayout.WEST, btnReturnToCourse, 64, SpringLayout.WEST, panel);
		sl_panel.putConstraint(SpringLayout.SOUTH, btnReturnToCourse, -37, SpringLayout.SOUTH, panel);
		panel.add(btnReturnToCourse);
	}
	public void setLable(String cName,String cID){
		lblName.setText(cName);
		lblCourseid.setText(cID);
		
	}
}
